#ifndef RM_MEETINGROOM_H
#define RM_MEETINGROOM_H

#include <QWidget>
#include <QMap>
#include "rm_userlist.h"

namespace Ui {
class RM_MeetingRoom;
}

#if defined(Q_OS_WIN32)
    #include "../winsdk/fastplay.h"
#elif defined(Q_OS_LINUX)
    #include "../sdk/play.h"
#endif




#define print printf

class RM_MeetingRoom : public QWidget
{
    Q_OBJECT

public:
    explicit RM_MeetingRoom(QWidget *parent = nullptr);
    ~RM_MeetingRoom();



#if defined(Q_OS_WIN32)
    IVideoSender* m_sender = NULL;
#elif defined(Q_OS_LINUX)
    if_avsender* m_sender;
#endif


#if defined(Q_OS_WIN32)
    IFastPlay* av;
#endif

    QVector<QWidget*> listavplayer;
#if defined(Q_OS_WIN32)
    QVector<IVideoPlayer*> listavrenders;
#elif defined(Q_OS_LINUX)
    QMap<QString,if_avplayer*> mapuserplay;
#endif


    void updateLoadVideos(QStringList users);
    void startPush(QString url);

public slots:
    void on_pushButton_user_clicked();
    void on_pushButton_exit_clicked();

    void on_toolButton_camera_clicked();
    void on_toolButton_mic_clicked();
    void on_toolButton_desktop_clicked();

protected:
    bool eventFilter(QObject* obj, QEvent *event);

private:
    Ui::RM_MeetingRoom *ui;
    rm_userlist* m_userlist;
    int videoflag=IVideoSender::FlagVideo;
    int audioflag=IVideoSender::FlagAudio;
    bool isscreen=false;
    bool bigmode=false;
};

#endif // RM_MEETINGROOM_H
